package main

import (
	"log"
	"net"
	"time"
)

func main(){
	conn, err := net.Dial("tcp", "127.0.0.1:8888")
	if err != nil {
		log.Println("dial error:", err)
		return
	}
	//defer conn.Close()
	time.Sleep(1*time.Second)
	buf := make([]byte, 1024)
	n, err := conn.Write(buf)
	log.Println(n, err)

	time.Sleep(1*time.Second)
	n, err = conn.Write(buf)
	log.Println(n, err)
}